<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>TI预算费用统计查询</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <!-- jqgrid-->
    <link href="__STATIC__/layout/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link rel="stylesheet" href="__STATIC__/layout/css/zTreeStyle.css" type="text/css">
     <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/sc/js/page.js"></script>
     <style>
  
    #pagesize{height:23px;}
    </style>
</head>

<body style="color:#333;padding:3px;">
    <!-- 标题 -->
     <div class="page-heade clearfix">
          <h2 class="clearfix text-center">
        <a class="col-md-3 title_color H_right" style="font-size: 16px;color:#333;" href="{:url('Mymubiao/mylingshoutongji')}?serid={$serid}">零售目标汇总</a>
        <a class="col-md-3 title_color H_right H_active" style="font-size: 16px;" href="{:url('Mymubiao/mylingshoumingxi')}?serid={$serid}">零售目标明细</a>
        <a class="col-md-3 title_color H_right" style="font-size: 16px;color:#333;"  href="{:url('Mymubiao/mylingshoumanage')}?serid={$serid}">零售目标管理</a>
         <a class="col-md-3 title_color" style="font-size: 16px;color:#333;"  href="{:url('Mymubiao/mylingshounoset')}?serid={$serid}">未设置目标的销售人员名单</a>
         </h2>
    </div>
   <form action="#" method="post" id="form_check" accept-charset="utf-8" class="form-horizontal formpage">
        <input type="hidden" value='{$page}' name="page" id="page-go"/>
        <input type="hidden" value='{$list}' name="list" id="list-go"/>
       <div class="form-group margin-10">
           <label class="col-sm-2 control-label text-right">城市：</label>

           <div class="col-sm-10">
             <div class="col-sm-3">
                 <select name="fenqu" id="fenqu" class="form-control">
                     <option value="0">请选择分区</option>
                      {volist name="fenqu" id="vof"}
                  {if condition="$vof.id eq $data.fenqu"}
                  <option value="{$vof.id}"  selected>{$vof.title}</option>
                  {else/}
                  <option value="{$vof.id}" >{$vof.title}</option>
                  {/if}
                {/volist}
                 </select>
             </div>
             <div class="col-sm-3">
                 <select name="sheng" id="sheng" class="form-control">
                  <option value="0">请选择省份</option>
                 
              </select>
             </div>
             <div class="col-sm-3">
                 <select name="shi" id="shi" class="form-control">
                  <option value="0">请选择城市</option>
                  
              </select>
             </div>
           </div>
       </div>
       
       <div class="form-group">
           <label class="col-sm-2 control-label text-right">产品：</label>
            
           <div class="col-sm-10">
            <div class="col-sm-3">
                 <select name="pinpai" id="pinpai" class="form-control">
                  <option value="0">请选择品牌</option>
                  {volist name="pinpai" id="vop"}
                {if condition="$data.pinpai eq $vop.id"}
                <option value="{$vop.id}" selected>{$vop.brand_name}</option>
                {else/}
                <option value="{$vop.id}">{$vop.brand_name}</option>
                {/if}
              {/volist}
              </select>
             </div>
           
           </div>
       </div>
       
       <div class="form-group">
           <label class="col-sm-2 control-label text-right">二级费用科目：</label>
           <div class="col-sm-10">
             <div class="col-sm-3">
                 <select name="yijifeiyong" id="yijifeiyong" class="form-control">
                  <option value="0">请选择一级科目</option>
                  {volist name="yijifeiyong" id="voyi"}
          {if condition="$data.yijifeiyong eq $voyi.id"}
            <option value="{$voyi.id}" selected>{$voyi.title}</option>
          {else/}
            <option value="{$voyi.id}">{$voyi.title}</option>
          {/if}
             {/volist}
              </select>
             </div>
             <div class="col-sm-3">
                <select  name="erjifeiyong" id="erjifeiyong" class="form-control">
                  <option value="0">请选择二级科目</option>
                 
              </select>
             </div>
              
              
           </div>
       </div>
       
       <div class="form-group">
           <label class="col-sm-2 control-label text-right">一级渠道：</label>
           <div class="col-sm-10">
             <div class="col-sm-3">
                <select name="channel1" class="form-control">
                  <option value="0">请选择一级渠道</option>
                   {volist name="qudao" id="voqd"}
          {if condition="$data.channel1 eq $voqd.id"}
          <option value="{$voqd.id}" selected>{$voqd.title}</option>
          {else/}
          <option value="{$voqd.id}">{$voqd.title}</option>
          {/if}
          {/volist}
              </select>
             </div>
              
           </div>
       </div>
       
       <div class="form-group">
           <label class="col-sm-2 control-label text-right">二级考核期：</label>
           <div class="col-sm-10">
            <div class="col-sm-3">
                <select name="cainian" id="cainian" class="form-control">
                  <option value="0">请选择财年</option>
                  {volist name="cainian" id="voc"}
                {if condition="$data.cainian eq $voc.id"}
                <option value="{$voc.id}" selected>{$voc.title}</option>
                {else/}
                <option value="{$voc.id}">{$voc.title}</option>
                {/if}
              {/volist}
              </select>
             </div>
              <div class="col-sm-3">
               <select class="form-control" name="yijikaoheqi" id="yijikaoheqi">
              <option value="0">请选择一级考核期</option>
              
            </select>
             </div>
              <div class="col-sm-3">
                <select class="form-control" name="erjikaoheqi" id="erjikaoheqi">
              <option value="0">请选择二级考核期</option>
              
            </select>
             </div>
           </div>
       </div>
       <div class="container-fluid margin-10 text-center">
        <input type="button" value="查询" class='btn btn-outline btn-primary' id="check"/>
        <input type="button" value="清空查询条件" class='btn btn-outline btn-warning' id="clear_check"/>
             
      </div>
      </form>
    <!-- 筛选 -->
    <!-- 筛选 -->
    <!-- 表格 -->
      <div class="col-md-12 no-padding"  style="padding: 0 12px;">
    {if condition="$sum neq 0"}
        <table class="table table-hover table-bordered text-center table-striped bud_hei" style="width: 100%; background: #fff;">
                <tr class="info">
                    <th class="text-center">明细编号</th>
                    <th class="text-center">销售人员</th>
                    <th  class="text-center">一级渠道</th>
                    <th  class="text-center">分区</th>
                    <th  class="text-center">省份</th>
                    <th  class="text-center">城市</th>
                    <th  class="text-center">产品品牌</th>
                    <th  class="text-center">产品品类</th>
                    <th  class="text-center">一级费用科目</th>
                    <th  class="text-center">二级费用科目</th>
                    <th  class="text-center">财年</th>
                    <th  class="text-center">一级考核期</th>
                    <th  class="text-center">二级考核期</th>
                    <th  class="text-center">预算金额(元)</th>
                </tr>
                {volist name="apply" id="vo"}
                <tr>
                    <td>{$vo.no}-{$vo.detail_no}</td>
                    <td>{$vo.ename}</td>
                    <td>{$vo.channel1}</td>
                    <td>{$vo.fenqu}</td>
                    <td>{$vo.sheng}</td>
                    <td>{$vo.shi}</td>
                    <td>{$vo.pinpai}</td>
                    <td>{$vo.pinlei}</td>
                    <td>{$vo.yijifeiyong}</td>
                    <td>{$vo.erjifeiyong}</td>
                    <td>{$vo.cainian}</td>
                    <td>{$vo.yijikaoheqi}</td>
                    <td>{$vo.erjikaoheqi}</td>
                    <td>{$vo.feiyong}</td>
                </tr>
                {/volist}
        </table>
        <h5 class="text-center" id="pagesc" style="font-size: 16px;font-weight: 500">
            <script>
                            $(function(){
                                pageSC("pagesc",{$sum},{$page},{$maxpage})
                            })
                        </script> 
          每页显示
          <select id="pagesize">
           
            <option value='20'{if condition="$list eq 20"}selected{/if}>20条</option>
      <option value='40'{if condition="$list eq 40"}selected{/if}>40条</option>
      <option value='50'{if condition="$list eq 50"}selected{/if}>50条</option>
          </select>
        </h5>
        {else/}
        <h3 class="text-center">对不起没有查询到符合条件的信息</h3>
        {/if}
       
      </div>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <!-- 自定义js -->
    <!-- <script src="js/hplus.js?v=4.1.0"></script> -->
    <!-- <script type="text/javascript" src="js/contabs.js"></script> -->
    <!-- Peity -->
    <script src="__STATIC__/layout/js/plugins/peity/jquery.peity.min.js"></script>
    <!-- jqGrid -->
    <script src="__STATIC__/layout/js/plugins/jqgrid/i18n/grid.locale-cn.js?0820"></script>
    <script src="__STATIC__/layout/js/plugins/jqgrid/jquery.jqGrid.min.js?0820"></script>
    <!-- 自定义js -->
    <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    <!-- ztree -->
    <script type="text/javascript" src="__STATIC__/layout/js/jquery.ztree.core.js"></script>
    <script type="text/javascript" src="__STATIC__/layout/js/jquery.ztree.excheck.js"></script>
    <script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
    <!-- <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script> -->
    <!--统计代码，可删除-->
    <!--     <script src="js/plugins/layer/laydate/laydate.js"></script> -->
     <script>
  //翻页
    
        $("#check").click(function(){
              $("#page-go").val(1);
              $(".formpage").submit();
        })
        $("#clear_check").click(function(){
            
            $("#page-go").val(1);
            
            $("select").val(0);
          
            $(".formpage").submit();
        })

         var kaohe1json='{$jsonkaohe1}';
        var kaohe1arr=JSON.parse(kaohe1json);
        var kaohe2json='{$jsonkaohe2}';
        var kaohe2arr=JSON.parse(kaohe2json);
        var jsonerjifeiyong='{$jsonerjifeiyong}';
        var feiyong2arr=JSON.parse(jsonerjifeiyong)


        var jsonsheng='{$jsonsheng}';
        var shengarr=JSON.parse(jsonsheng)
        var jsonshi='{$jsonshi}';
        var shiarr=JSON.parse(jsonshi)
      
           {if $data.yijifeiyong}
            erfeixy();

            {/if}
            {if $data.erjifeiyong}
            $("#erjifeiyong").val({$data.erjifeiyong})

            {/if}
            {if $data.cainian}
            yikaoxy();
            {/if}
            {if $data.yijikaoheqi}
            $("#yijikaoheqi").val({$data.yijikaoheqi})
            erkaoxy();
            {/if}
            {if $data.erjikaoheqi}
               $("#erjikaoheqi").val({$data.erjikaoheqi})
            {/if}
            {if $data.fenqu}
              $("#fenqu").val({$data.fenqu})
              shengxy();
            {/if}
            {if $data.sheng}
              $("#sheng").val({$data.sheng})
              shixy();
            {/if}
            {if $data.shi}
              $("#shi").val({$data.shi})
             
            {/if}
           
        $(function(){
          $("#cainian").change(function(){
            
            yikaoxy();
            erkaoxy();
            
          })
          $("#yijikaoheqi").change(function(){
            
            erkaoxy();
          })
          $("#yijifeiyong").change(function(){
            
            erfeixy();
          })
          $("#fenqu").change(function(){
            
            shengxy();
            
            shixy();
            
            
          })
          $("#sheng").change(function(){
            
            shixy();
            
           
          })
          
        })
     //一级考核期显示隐藏
      function yikaoxy(){
        $("#yijikaoheqi").html('<option value="0">请选择一级考核期</option>')
        for(var i=0;i<kaohe1arr.length;i++){
          if(kaohe1arr[i]["cainian"]==$("#cainian").val()){
            $("#yijikaoheqi").append('<option value="'+kaohe1arr[i]["id"]+'">'+kaohe1arr[i]["title"]+'</option>')
          }
        }
        erkaoxy();
      }
      //二级考核期显示隐藏
       function erkaoxy(){
         $("#erjikaoheqi").html('<option value="0">请选择二级考核期</option>')
         for(var i=0;i<kaohe2arr.length;i++){
          if(kaohe2arr[i]["yijikaoheqi"]==$("#yijikaoheqi").val()){
            $("#erjikaoheqi").append('<option value="'+kaohe2arr[i]["id"]+'">'+kaohe2arr[i]["title"]+'</option>')
          }
        }
      }
      //二级费用科目显示隐藏
      function erfeixy(){
        //feiyong2arr
        $("#erjifeiyong").html('<option value="0">请选择二级科目</option>')
        for(var i=0;i<feiyong2arr.length;i++){
          if(feiyong2arr[i]["yijifeiyong"]==$("#yijifeiyong").val()){
            $("#erjifeiyong").append('<option value="'+feiyong2arr[i]["id"]+'">'+feiyong2arr[i]["title"]+'</option>')
          }
        }
      }
      //省显示隐藏
      function shengxy(){
        $("#sheng").html("<option value='0'>请选择省份</option>")
        for(var i=0;i<shengarr.length;i++){
          if(shengarr[i]["fenqu"]==$("#fenqu").val()){
            $("#sheng").append('<option value="'+shengarr[i]["id"]+'">'+shengarr[i]["title"]+'</option>')
          }
        }
      }
      //市显示隐藏
      function shixy(){
        $("#shi").html("<option value='0'>请选择城市</option>")
        for(var i=0;i<shiarr.length;i++){
          if(shiarr[i]["sheng"]==$("#sheng").val()){
            $("#shi").append('<option value="'+shiarr[i]["id"]+'">'+shiarr[i]["title"]+'</option>')
          }
        }
      }
    </script>
</body>

</html>